<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020-03-12
 * Time: 23:48
 */

namespace zwwl2016\cloudrunner;


class SimpleLaravelCloudRunner
{
    private $cloudExecutor;

    public function __construct()
    {
        $this->cloudExecutor=CloudRunner::Instance()
            ->setRequires(TransferDomainRequires::$Laravel)
            ->setNeedResponse(false)
            ->setSyncFiles(true)
            ->setBroadcast(false)
            ->setIncludeSelf(false);
    }

    public static function Instance()
    {
        $instance=new SimpleLaravelCloudRunner();
        return $instance;
    }

    public function setRunner(iCloudModule $runner)
    {
        $this->cloudExecutor->setRunner($runner);
        return $this;
    }

    public function setParameters(array $parameters)
    {
        $this->cloudExecutor->setParameters($parameters);
        return $this;
    }

    public function execute()
    {
        $this->cloudExecutor->execute();
        return $this;
    }

    public function getResultList()
    {
        return $this->cloudExecutor->getResultList();
    }
}
